/*
 * @Author: 徐建辰
 * @Date: 2021-11-04 11:11:58
 * @LastEditTime: 2021-11-04 11:42:05
 * @LastEditors: Please set LastEditors
 * @Description: 城市名字组件
 */
import React, {memo} from 'react'
import PropTypes from 'prop-types'
import './CitySelector.css'

const CityItem = memo(function CityItem(props) {
  const {name, onSelect} = props
  return (
    <li className="city-li" onClick={() => onSelect(name)}>{name}</li>
  )
})

CityItem.propTypes = {
  name: PropTypes.string.isRequired,
  onSelect: PropTypes.func.isRequired,
}

export default CityItem

